/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "City")
@NamedQueries({
    @NamedQuery(name = "City.findAll", query = "SELECT c FROM City c"),
    @NamedQuery(name = "City.findByCityID", query = "SELECT c FROM City c WHERE c.cityID = :cityID"),
    @NamedQuery(name = "City.findByCityName", query = "SELECT c FROM City c WHERE c.cityName = :cityName"),
    @NamedQuery(name = "City.findByDescription", query = "SELECT c FROM City c WHERE c.description = :description")})
public class City implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "cityID")
    private Integer cityID;
    @Column(name = "cityName")
    private String cityName;
    @Column(name = "description")
    private String description;
    @OneToMany(mappedBy = "city")
    private List<TourPack> tourPackList;
    @OneToMany(mappedBy = "city1")
    private List<TourPack> tourPackList1;
    @OneToMany(mappedBy = "city")
    private List<Hotel> hotelList;
    @OneToMany(mappedBy = "city")
    private List<Routing> routingList;

    public City() {
    }

    public City(Integer cityID) {
        this.cityID = cityID;
    }

    public Integer getCityID() {
        return cityID;
    }

    public void setCityID(Integer cityID) {
        this.cityID = cityID;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<TourPack> getTourPackList() {
        return tourPackList;
    }

    public void setTourPackList(List<TourPack> tourPackList) {
        this.tourPackList = tourPackList;
    }

    public List<TourPack> getTourPackList1() {
        return tourPackList1;
    }

    public void setTourPackList1(List<TourPack> tourPackList1) {
        this.tourPackList1 = tourPackList1;
    }

    public List<Hotel> getHotelList() {
        return hotelList;
    }

    public void setHotelList(List<Hotel> hotelList) {
        this.hotelList = hotelList;
    }

    public List<Routing> getRoutingList() {
        return routingList;
    }

    public void setRoutingList(List<Routing> routingList) {
        this.routingList = routingList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cityID != null ? cityID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof City)) {
            return false;
        }
        City other = (City) object;
        if ((this.cityID == null && other.cityID != null) || (this.cityID != null && !this.cityID.equals(other.cityID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.City[cityID=" + cityID + "]";
    }

}
